<template>
  <div class="home" style="height:100vh;">
    <el-container style="height: 100%;">
      <el-aside>
        <el-col :span="24">
          <div class="logo">
            <img src="../assets/logo.png" alt="" width="35px" height="35px" class="logoimg">
            <p class="logo-title">
              学生后台管理登录
            </p>
          </div>
          <el-menu default-active="/Students" class="el-menu-vertical-demo" background-color="rgb(26, 35, 60)"
            text-color="#fff" @open="handleOpen" @close="handleClose" router>
            <el-menu-item index="Students">
              <i class="el-icon-s-home"></i>
              <span slot="title">学生后台管理</span>
            </el-menu-item>
            <el-menu-item index="about">
              <i class="el-icon-chicken"></i>
              <span slot="title">富文本编辑器</span>
            </el-menu-item>
          </el-menu>
        </el-col>
      </el-aside>
      <el-container>
        <el-header>
          <!-- Header -->
          <el-row>
            <el-col :span="2">
              <div class="grid-content bg-purple" style="text-align: left;">

              </div>
            </el-col>
            <el-col :span="22"
              style="text-align: right;  display: flex; justify-content: flex-end; align-items: center; margin-top: 10px">
              <el-avatar style="margin-right: 2vh" :size="40">
                <img src="https://q6.itc.cn/q_70/images03/20240405/7270f230b695441b85fa9374752beab6.jpeg" />
              </el-avatar>
              <el-dropdown @command="handleCommand">
                <span class="el-dropdown-link">
                  账号:{{ username }}<i class="el-icon-arrow-down el-icon--right"></i>
                </span>
                <el-dropdown-menu slot="dropdown">
                  <el-dropdown-item command="a">个人中心</el-dropdown-item>
                  <el-dropdown-item command="b">退出</el-dropdown-item>
                </el-dropdown-menu>
              </el-dropdown>
            </el-col>
          </el-row>
        </el-header>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script>



export default {
  data() {
    return {
      username: "admin",
    }
  },
  methods: {
    handleOpen() {

    },
    handleClose() {

    },
    handleCommand(command) {
      if (command == "b") {
        this.$router.push({ name: 'login' }); // 假设你已经在Vue Router中定义了一个名为'home'的路由
      }
    }
  },
}
</script>
<style>
/* /个人中心/ */
.el-dropdown-link {
  cursor: pointer;
  color: #409EFF;
}

.el-icon-arrow-down {
  font-size: 12px;
}


.logo-title {
  font-weight: 600;
  font-size: 18px;
  line-height: 34px;
}

.home {
  height: 100%;
}

.logo {
  width: 100%;
  height: 50px;
  display: flex;
  justify-content: center;
  background-color: rgb(18, 26, 44);
  color: #E9EEF3;
}

.el-header,
.el-footer {
  background-color: #ffffff;
  color: #333;
  text-align: center;
}

.el-header {
  padding: 0 !important;
}

.el-aside {
  background-color: rgb(26, 35, 60);
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: rgb(247, 247, 247);
  color: #333;
  padding: 0 !important;
}

body>.el-container {
  margin-bottom: 40px;

}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
</style>